<template>
  <view class="balance-page">
    <!-- 红色背景区域 -->
    <view class="red-background"></view>
    
    <!-- 余额卡片区域 - 覆盖在红色背景上 -->
    <view class="balance-section">
      <view class="balance-card">
        <view class="balance-header">
          <text class="balance-title">我的余额（元）</text>
        </view>
        <view class="balance-amount">
          <text class="amount-text">{{ balance }}</text>
        </view>
        <view class="recharge-section">
          <button class="recharge-btn" @click="handleRecharge">充值</button>
        </view>
      </view>
    </view>

    <!-- 余额明细区域 -->
    <view class="detail-section">
      <view class="detail-card">
        <view class="detail-header">
          <text class="detail-title">余额明细</text>
        </view>
        <view class="detail-content">
          <!-- 空状态 -->
          <view class="empty-state">
            <view class="empty-icon">
              <image class="empty-icon-image" src="/static/balance/钱包余额财务.png"></image>
            </view>
            <text class="empty-text">暂无余额明细</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      balance: '0.00', // 余额
      detailList: [] // 空明细列表
    }
  },
  methods: {
    // 充值逻辑
    handleRecharge() {
      uni.navigateTo({
        url: '/pages/balanceActive/balanceActive'
      });
    }
  }
}
</script>

<style scoped>
/* 页面基础样式 */
.balance-page {
  min-height: 100vh;
  background-color: #f5f5f5;
  position: relative;
}

/* 红色背景区域 - 作为背景 */
.red-background {
  /* 更鲜艳的红色（高饱和度）：#ff3838 比原 #ff4757 更鲜艳 */
  background-color: #ff3838; 
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  border-radius: 0 0 12px 12px;
  z-index: 1;
}

/* 余额卡片区域 - 覆盖在红色背景上 */
.balance-section {
  position: relative;
  z-index: 2;
  padding: 20px 16px;
  margin-bottom: 20px;
}

.balance-card {
  background-color: #fff;
  border-radius: 12px;
  padding: 24px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 2;
}

/* 卡片顶部红色线条（可选，也用鲜艳红色） */
.red-line {
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  /* 线条也用鲜艳红色 */
  background-color: #ff3838;
  border-radius: 1px;
}

.balance-header {
  text-align: center;
  margin-bottom: 16px;
  margin-top: 8px;
}

.balance-title {
  font-size: 16px;
  color: #666;
  font-weight: 500;
}

.balance-amount {
  text-align: center;
  margin-bottom: 24px;
}

.amount-text {
  font-size: 36px;
  font-weight: bold;
  color: #333;
}

.recharge-section {
  text-align: center;
}

.recharge-btn {
  /* 按钮也用鲜艳红色，保持一致性 */
  background-color: #ff3838;
  color: #fff;
  border: none;
  border-radius: 25px;
  padding: 12px 40px;
  font-size: 16px;
  font-weight: 500;
  width: 120px;
  height: 44px;
  line-height: 20px;
}

.recharge-btn:active {
  /* 点击时略深一点的鲜艳红色 */
  background-color: #ff2020;
}

/* 余额明细区域 */
.detail-section {
  padding: 0 16px;
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.detail-card {
  background-color: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.detail-header {
  margin-bottom: 20px;
}

.detail-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.detail-content {
  min-height: 200px;
}

/* 空状态样式 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.empty-icon {
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-icon-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.empty-text {
  font-size: 14px;
  color: #999;
}
</style>